package emtext;

import java.util.ArrayList;
import java.util.Queue;

public class text {
    public static void main(String[] args) {
        Employee e1 = new FullTimeEmployee(1, "张三", 5000);
        Employee e2 = new PartTimeEmployee(2, "李四", 40, 8);
        System.out.println(e1.calculateSalary());
        System.out.println(e2.calculateSalary());
        Manager m1 = new Manager(3, "王五",500, 5000);
        System.out.println(m1.calculateSalary());
        // 使用 ArrayList 存储所有员工
        ArrayList<Employee> employees = new ArrayList<>();
        employees.add(e1);
        employees.add(e2);
        employees.add(m1);

        // 遍历输出员工信息
        for (Employee employee : employees) {
            employee.displayInfo();

            // 如果是 Manager，调用 Bonus 接口的方法
            if (employee instanceof Manager) {
                ((Manager) employee).printBonus();
            }

            System.out.println("-----------------------------");
        }
    }
}
